﻿@model List<AppVulneravel.Models.Contatos>

@{
    ViewBag.Title = "Página Inicial";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
<h2>Agenda telefônica do(a) @Request.Cookies["Login"]["Nome"]</h2>
<p>
    <a class="btn btn-success btn-sm" href="~/Home/CriarContato" title="Adicionar novo contato">Acidionar novo contato <span class="glyphicon glyphicon-plus"></span></a>
    <a class="btn btn-primary btn-sm" href="~/Home/PesquisarContato" title="Adicionar novo contato">Pesquisar por nome <span class="glyphicon glyphicon-search"></span></a>
</p>
<div class="table-responsive">
    <table class="table table-bordered table-hover">
        <thead>
            <tr>
                <th>Nome</th>
                <th>Email</th>
                <th>Telefone</th>
                <th>Celular</th>
                <th>Telefone Comercial</th>
                <th>Ações</th>
            </tr>
        </thead>
        <tbody>
            @foreach (var item in Model)
            {
                <tr>
                    <td>@Html.Raw(@item.Nome)</td>
                    <td>@Html.Raw(@item.Email)</td>
                    <td>@Html.Raw(@item.Telefone)</td>
                    <td>@Html.Raw(@item.Celular)</td>
                    <td>@Html.Raw(@item.TelComercial)</td>
                    <td>
                        <a class="btn btn-warning btn-sm" href="~/Home/AlteraContato/@item.Id" title="Alterar Contato">Alterar <span class="glyphicon glyphicon-edit"></span></a>
                        <a class="btn btn-danger btn-sm" href="~/Home/ExcluiContato/@item.Id" title="Excluir Contato">Excluir <span class="glyphicon glyphicon-remove-circle"></span></a>
                    </td>
                </tr>
            }
        </tbody>
    </table>
</div>
